package com.nnnu.orange.pojo.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Pattern;
import java.time.LocalDate;

@Data
public class UserDto {
    private Integer userId;
    private String username;
    private String fullName;
    @Email
    private String email;
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确，必须是以1开头的11位数字")
    private String phone;

    private String address;
    @Range(min = 0, max = 1, message = "status 只能为 0 或 1")
    private Integer status;

    @Range(min = 0, max = 1, message = "membershipType 只能为 0 或 1")
    private Integer membershipType;
    @URL
    private String profilePictureUrl;

    @Range(min = 1, max = 2, message = "gender 只能为 1 或 2")
    private Integer gender;

    private LocalDate birthDate;
}
